﻿using MediatR;
using Reborn.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Reborn.MicroKernel.Register
{
    public class MediatorRegister
    {
        public static void Handler(Config config)
        {
            //注册消息
            List<Assembly> mediatRegisterAssemblyTypesList = PluginsServiceProvider.Instance.GetPluginsAssembly();

            if (mediatRegisterAssemblyTypesList.Count > 0)
            {
                MediatServiceProvider.Instance.RegisterAssemblyTypes(mediatRegisterAssemblyTypesList.ToArray());
            }
            MediatServiceProvider.Instance.Build();
        }
    }
}
